<template>
  <div>
<div class="title">
    <div @click="num='0'">热门商品0</div>
    <div @click="num='1'">热门商品1</div>
    <div @click="num='2'">热门商品2</div>
</div>
<div class="list" v-for="item in arr" :key="item.id">
    <img :src="$pre + item.content[num].img" alt="">
    <div>name:{{item.content[num].goodsname}}</div>
    <div>price:{{item.content[num].price | filterPrice}}</div>
</div>
    
  </div>
</template>

<script>
import {reqhomegoods} from "../../../http/http"
import axios from 'axios'
export default {
  data(){
    return{
      //初始化数据
      arr:[],
      num:0
    }
  },
  mounted(){
      reqhomegoods().then(res=>{
      console.log(res);
      this.arr = res.data.list
      console.log(this.arr);
    })
  }
}
</script>

<style>

</style>